package com.aviator.detective.script.method;

import com.aviator.detective.common.util.DateUtil;
import com.googlecode.aviator.runtime.function.AbstractFunction;
import com.googlecode.aviator.runtime.type.AviatorLong;
import com.googlecode.aviator.runtime.type.AviatorObject;

import java.util.Map;

public class CurrentTimeMethod extends AbstractFunction {
    @Override
    public AviatorObject call(Map<String, Object> env) {
        return AviatorLong.valueOf(DateUtil.getCurrentUnixTime());
    }

    public String getName() {
        return "currentTime";
    }
}
